package com.usian.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class JdbcConfiguration {
    @Value("${jdbc.name}")
    String name;
    @Value("${jdbc.url}")
    String url;

    @Bean
    public DruidDataSource dataSource(){
        DruidDataSource druidDataSource = new DruidDataSource();
        druidDataSource.setName(name);
        druidDataSource.setUrl(url);
        return druidDataSource;
    }

}
